#!/bin/bash

# launch_visualization.sh - 启动 MTC 可视化演示的脚本

echo "🎬 启动 Scepter MTC 可视化演示"
echo "================================"

# 检查是否在正确的目录
if [ ! -d "../../scepter_moveit_config" ]; then
    echo "❌ 错误：请在 src/scepter_motion 目录下运行此脚本"
    echo "正确路径：cd /home/parallels/PycharmProjects/aghanim-scepter/src/scepter_motion"
    exit 1
fi

echo "📍 当前目录：$(pwd)"
echo ""

echo "🚀 步骤1：启动 MoveIt 和 RViz"
echo "在新终端中运行以下命令："
echo "----------------------------------------"
echo "cd /home/parallels/PycharmProjects/aghanim-scepter"
echo "source /opt/ros/jazzy/setup.bash"
echo "ros2 launch scepter_moveit_config demo.launch.py"
echo "----------------------------------------"
echo ""

read -p "👆 RViz 启动完成后按 ENTER 继续..."

echo ""
echo "🎯 步骤2：运行 MTC 可视化演示"
echo "即将启动 MTC 演示，请观察 RViz 中的机器人运动..."
echo ""

# 设置环境
export ROS_PACKAGE_PATH="/home/parallels/PycharmProjects/aghanim-scepter/src:/opt/ros/jazzy/share"

# 运行可视化演示
python3 scepter_motion/scepter_motion_visualized.py

echo ""
echo "🏁 演示完成！"